package model.DAO;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import model.Entity.SIS.AcademicCalendar;

@Repository("AcademicCalendarDAO")
public class AcademicCalendarDAO extends GenericDAO {
	
	
	public List<AcademicCalendar> findAll(){
		List<AcademicCalendar> list = super.findAll(AcademicCalendar.class);
		return list;
	}
	
	public List<AcademicCalendar> findBySemester(int semester){
		Map<String, Integer> paramMap = new HashMap<String, Integer>();
		paramMap.put("semester", semester);
		List<AcademicCalendar> list = super.findByNamedQuery(AcademicCalendar.class, "findBySemester", paramMap);
		return list;
	}
	
	public List<AcademicCalendar> findByStudyCode(int studyCode){
		Map<String, Integer> paramMap = new HashMap<String, Integer>();
		paramMap.put("studyCode", studyCode);
		List<AcademicCalendar> list = super.findByNamedQuery(AcademicCalendar.class, "findByStudyCode", paramMap);
		return list;
	}
	
	public List<AcademicCalendar> findBySemesterAndStudyCode(int semester, int studyCode){
		Map<String, Integer> paramMap = new HashMap<String, Integer>();
		paramMap.put("studyCode", studyCode);
		paramMap.put("semester", semester);
		List<AcademicCalendar> list = super.findByNamedQuery(AcademicCalendar.class, "findByStudyCode", paramMap);
		return list;
	}

}
